using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TouchCargoTrigger : MonoBehaviour
{
    public AGVObject agv;

    [SerializeField]
    Transform touchedCargo;

    public void OnTriggerEnter(Collider other)
    {
        if (agv != null && agv.GetTouchCargo() != null)
        {
            touchedCargo = agv.GetTouchCargo().GetTouchedCargo(other.transform);
        }
    }

    public void OnTriggerExit(Collider other)
    {
        if (agv != null && agv.GetTouchCargo() != null)
        {
            touchedCargo = agv.GetTouchCargo().LeaveTouchedCargo(other.transform);
        }
    }
}
